package com.yb.designpattern.creation.singleton;

/**
 * 静态内部类方式 推荐写法：线程安全且保证实例唯一
 * @author Administrator
 *
 */
public class StaticInnerClassSingleton {
	private StaticInnerClassSingleton(){}
	private static class SingletonHolder{
		private static final StaticInnerClassSingleton instance = new StaticInnerClassSingleton();
	}
	
	public static final StaticInnerClassSingleton getInstance(){
		return SingletonHolder.instance;
	}
}
